www.gusucode.com > 6KBBS ASP版 V7.1 > 6KBBS ASP版 V7.1\code\bbs\adminbd.asp
<!--#include file="up.asp"--> <% if usertype<3 or (usertype=3 and instr("|"&adminbd&"|","|"&bd&"|")=0) then tl=" 操 作 失 败" mes="<b>对不起!权限不够。</b>" call sendinfo(tl,mes) call down response.end end if function gettop() idtop=conn.execute("select top 1 top from topic where id="&id&" and bd="&bd&"")(0) end function %> <div class=adminbdlan><a href="adminbd.asp?bd=<%=bd%>&action=gonggao">发布公告</a> | <a href="adminbd.asp?bd=<%=bd%>&action=gonggaogl">公告管理</a><%if bdtype=3 then%> | <a href="adminbd.asp?action=passuser&bd=<%=bd%>"> 认证用户</a><%end if%> | <a href="adminbd2.asp?action=recycle&bd=<%=bd%>">回 收 站</a></div> <% dim action,content,content2,contentok,ggtitle,ggok,bad,b,paper,sql,markn,umarkuserid,rs1 function umark(markn) umarkuserid=conn.execute("select top 1 userid from topic where id="&id&"")(0) set rs1=server.createobject("adodb.recordset") sql="Select top 1 mark,del from [user] where userid="&umarkuserid&"" rs1.open sql,conn,1,3 rs1("mark")=rs1("mark")+int(markn) if rs1("mark")<0 then rs1("del")=true application(prefix&"deluser")=application(prefix&"deluser")&"|"&umarkuserid&"|" end if rs1.Update rs1.close set rs1=nothing end function function umark2(markn) umarkuserid=conn.execute("select top 1 userid from bbs"&totable&" where bbsid="&bbsid&"")(0) set rs1=server.createobject("adodb.recordset") sql="Select top 1 mark,del from [user] where userid="&umarkuserid&"" rs1.open sql,conn,1,3 rs1("mark")=rs1("mark")+int(markn) if rs1("mark")<0 then rs1("del")=true end if rs1.Update rs1.close set rs1=nothing end function function checkbad(str) if isnull(str) then exit function bad=split(application(prefix&"badcontent"), "|") for b=0 to ubound(bad) str=Replace(str,bad(b),string(len(bad(b)),"*")) next checkbad=str end function action=request.querystring("action") select case action %> <%case"gonggao"%> <SCRIPT> function checkeditor(editor) { if(editor=="html") { document.getElementById("ubbeditordiv").style.display = 'none'; document.getElementById("htmltoolbar").style.display = 'block'; EDITFORM_DOCUMENT.body.innerHTML = document.getElementById("CodeForm").value; document.getElementById("editTextarea").style.display = 'none'; document.getElementById("editIframe").style.display = 'block'; HtmlDisableToolbar(false); } else if(editor=="ubb") { document.getElementById("ubbeditordiv").style.display = 'block'; document.getElementById("htmltoolbar").style.display = 'none'; document.getElementById("CodeForm").value = HtmlHtmlToXhtml(EDITFORM_DOCUMENT.body.innerHTML); document.getElementById("editIframe").style.display = 'none'; document.getElementById("editTextarea").style.display = 'block'; HtmlDisableToolbar(true); } } function preview() { if(htmlsubmit()){ document.form1.topic.value=document.topicform.ggtitle.value; document.form1.content.value=document.topicform.content.value; var popupWin = window.open('paper.asp?action=preview', 'showgg', 'width=500,height=400,resizable=1,scrollbars=yes,menubar=no,status=yes'); document.form1.submit() } } </SCRIPT> <div class=adminbdtitle>发布公告</div> <div class=adminbdbody> <form method="POST" action="adminbd.asp?action=savegg&bd=<%=bd%>" name="topicform" onsubmit="htmlsubmit()"> <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%"> <tr> <td width="200"> <p style="line-height: 120%; margin: 4"><b>公告标题:</b></td> <td> <p style="line-height: 120%; margin: 4"> <input type="text" name="ggtitle" size="80"></td> </tr> <tr> <td valign="top" width="200"> <p style="line-height: 150%; margin: 5"><b>帖子内容:</b><br> <input type="radio" name="usereditor" value="html" onclick="checkeditor('html')" checked>使用Html编辑器<br> <input type="radio" name="usereditor" value="ubb" onclick="checkeditor('ubb')">使用UBB编辑器<br> </td> <td valign="top" style="padding:5px;"> <textarea name="content" cols="40" rows="2" style="display:none"></textarea> <SCRIPT src="Editor/Ubb/UbbEditor.js"></SCRIPT> <script type="text/javascript" src="Editor/Html/htmlEditor.js"></script> <script> var ubbedit=new UbbEditor("CodeForm",100,14,"default values","editor/ubb/images/"); ubbedit.showeditor(); </script> <script type="text/javascript"> var editor = new htmlEditor("editor"); editor.hiddenName = "content"; editor.width = "100%"; editor.height = "300px"; editor.imagePath="editor/html/images/"; editor.iconPath = 'editor/html/images/face/'; editor.show(); var strlength; //提交表单 function submitform(){ if(htmlsubmit()) {document.topicform.submit();} } //检测表单 function htmlsubmit() { if(document.getElementsByName("usereditor").item(0).checked==true){ var content = editor.data(); } else if(document.getElementsByName("usereditor").item(1).checked==true){ checkeditor("html"); var content = editor.data(); checkeditor("ubb"); } strlength=document.getElementsByName("content").item(0).value.length; if (strlength>25600||strlength<5){ alert("您输入的文章长度为"+strlength+",长度必须大于5且小于25600,请修正之后再继续。"); return false; } else if(document.getElementsByName("ggtitle").item(0).value==""){ alert("标题不能为空。"); document.getElementsByName("ggtitle").item(0).focus(); return false; } else{ return true; } } </script> </td> </tr> <tr> <td colspan="2" align="center" height="40" > <input class=submit type=button value=OK_!发送 name=B1 onclick="submitform()"> <input class=submit type=button value="预 览!" onclick=preview()> <input class=submit type=reset value=NO_!重写 name=B2> [ 按 Alt+Enter 直接发送 ]</td> </tr> </table> </form></div> <form name=form1 action=paper.asp?action=preview method=post target=showgg> <input type=hidden name=topic value=><input type=hidden name=content value=> </form> <%case"savegg" ggtitle=Replace(Request.Form("ggtitle"),"'","") ggtitle=replace(ggtitle,"|","│") ggok=Replace(ggtitle," ","") content=checkbad(Request.Form("content")) content=replace(content,"|","│") content=replace(content,"'","''") contentok=Replace(content," ","") if ggok="" or contentok="" then tl=" 发 送 失 败" mes="<b>对不起!公告发送失败,可能存在以下问题。</b><br>·请填写完整公告标题和公告内容。<br>·<a href='javascript:history.go(-1)'><img src="&styleid&"/re.gif align=absmiddle border=0> 返回重新填写</a>" else content2=ggtitle&"|"&lgname&"|"&now()+timeset/24&"|"&content conn.execute("insert into paper(paper,bd) values('"&content2&"',"&bd&")") tl=" 发 送 成 功" mes="·公告发送成功。" end if call sendinfo(tl,mes) %> <%case"passuser" %> <div class=adminbdtitle>认证用户</div> <div class=adminibdbody> <form method="POST" action="adminbd.asp?action=editpassuser&bd=<%=bd%>"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%"> <%if bdtype=3 then%><tr> <td valign="top" width="30%"> <p style="line-height: 120%; margin: 8"><b>版面认证用户:</b><br> 该版面为认证版面,<br>请输入能够进入该版面的用户名。<br>各个用户名用<font color="#FF0000"> | </font> 隔开,<br>输入过程中<b><font color="#FF0000">不能按 Enter</font></b>。<br> </td> <td width="70%"> <p style="margin: 5"> <textarea name="passuser" cols="70" style="font-family: 宋体; font-size: 9pt" rows="8"><%=passuser%></textarea></td> </tr> <%end if%> <tr> <td colspan="2" height="40" align="center"> <input type="submit" value=" 确 认 修 改 " name="B1"> <input type="reset" value=" 取 消 修 改 " name="B2"></td> </tr> </table> </form> </div> <%set rs=nothing%> <%case"editpassuser" passuser=Replace(Request.Form("passuser"),"'","''") conn.execute("update bdinfo set passuser='"&passuser&"' where id="&bd&" and followid<>0") tl=" 编 辑 成 功" mes="版面认证用户编辑成功。" call sendinfo(tl,mes) %> <%case"gonggaogl" set rs=conn.execute("select * from paper where bd="&bd&" order by id desc") %> <div class=adminbdtitle>版面现有公告</div> <div class=adminbdbody> <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%"> <tr><td width="40%" height=28 > <b>公告标题:</b></td> <td width="20%" > <b>发表者:</b></td><td width="20%" > <b>发表时间:</b></td> <td width="20%" > <b>公告操作:</b></td></tr> <%do while not rs.eof paper=rs("paper") paper=split(paper,"|") %><tr><td width="40%"> <p style="margin: 4"> <a href=# onclick=openscript('paper.asp?id=<%=rs("id")%>')><%=lefttrue(checktitle(paper(0)),25)%></a></td> <td width="20%"> <%=checktitle(paper(1))%></td><td width="20%"> <%=paper(2)%></td> <td width="20%"> <a href="adminbd.asp?action=delgg&id=<%=rs("id")%>&bd=<%=bd%>">删除</a> | <a href="adminbd2.asp?action=editgg&id=<%=rs("id")%>&bd=<%=bd%>">编辑</a></td></tr><%rs.movenext loop%> </table> </div><%set rs=nothing%> <%case"delgg" conn.execute("delete*from paper where id="&id&" and bd="&bd&"") tl=" 删 除 成 功" mes="删除公告成功。" call sendinfo(tl,mes)%> <%case"editggok" ggtitle=Replace(Request.Form("ggtitle"),"'","") ggok=Replace(ggtitle," ","") content=checkbad(Request.Form("content")) content=replace(content,"|","│") content=replace(content,"'","''") contentok=Replace(content," ","") if ggok="" or contentok="" then tl=" 修 改 失 败" mes="<b>对不起!公告修改失败,可能存在以下问题。</b><br>·请填写完整公告标题和公告内容。<br>·<a href='javascript:history.go(-1)'><img src"&styleid&"/re.gif align=absmiddle border=0> 返回重新填写</a>" else content2=ggtitle&"|"&lgname&"|"&now()+timeset/24&"|"&content conn.execute("update [paper] set paper='"&content2&"' where id="&id&" and bd="&bd&"") tl=" 修 改 成 功" mes="·公告修改成功。" end if call sendinfo(tl,mes) case"top" gettop() if idtop=2 then tl=" 操 作 失 败" mes="<b>操作失败,可能存在以下问题。</b><br>·该帖子已经被总置顶,不能够被版主置顶。<br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" else set rs=server.createobject("adodb.recordset") sql="Select top 1 top from [topic] where bd="&bd&" and id="&id&"" rs.open sql,conn,1,3 rs("top")=1 rs.Update rs.close set rs=nothing tl=" 置 顶 成 功" mes="<b>置顶帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" end if umark(30) call sendinfo(tl,mes) case"good" conn.execute("update topic set type=1 where bd="&bd&" and id="&id&"") tl=" 设 定 成 功" mes="<b>设定为精华帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" umark(50) call sendinfo(tl,mes) case"lock" conn.execute("update topic set type=2 where bd="&bd&" and id="&id&"") tl=" 锁 定 成 功" mes="<b>锁定帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" call sendinfo(tl,mes) case"delbbs" conn.execute("update topic set type=3 where bd="&bd&" and id="&id&"") conn.execute("update bbs"&totable&" set type=3 where bd="&bd&" and id="&id&"") tl=" 删 除 成 功" mes="<b>删除帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。" umark(-30) call sendinfo(tl,mes) case"update" conn.execute("update topic set edittime=now()+"×et&"/24 where bd="&bd&" and id="&id&"") tl=" 提 升 成 功" mes="<b>提升帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" call sendinfo(tl,mes) case"deltop" gettop() if idtop=2 then tl=" 操 作 失 败" mes="<b>操作失败,可能存在以下问题。</b><br>·该帖子已经被总置顶,不能够被版主取消置顶。<br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" else set rs=server.createobject("adodb.recordset") sql="Select top 1 top from [topic] where bd="&bd&" and id="&id&"" rs.open sql,conn,1,3 rs("top")=0 rs.Update rs.close set rs=nothing tl=" 操 作 成 功" mes="<b>取消置顶成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" end if call sendinfo(tl,mes) case"delgood" conn.execute("update topic set type=0 where bd="&bd&" and id="&id&"") tl=" 设 定 成 功" mes="<b>设取消精华帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" call sendinfo(tl,mes) case"dellock" conn.execute("update topic set type=0 where bd="&bd&" and id="&id&"") tl=" 解 锁 成 功" mes="<b>解锁帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" call sendinfo(tl,mes) case"move" %><script> function changelist(){ var choosename=document.getElementsByName("bd").item(0); var chooseint=choosename.selectedIndex; var choosevalue=choosename.options[chooseint].value; if(choosevalue==0){ alert("不能选择分类,只能选择版面!"); choosename.options[0].selected=true; return false; } } </script> <form method="POST" action="adminbd.asp?action=moveok&bd=<%=bd%>&id=<%=id%>&totable=<%=totable%>" onsubmit="return changelist();"> <div class=adminbdtitle>移动帖子</div><div class=adminbdbody><p style="margin:8px;">请选择帖子要移动到的版面: <% set rs=conn.execute("select * from bdinfo where followid=0 order by orders desc,id") response.write"<select size=1 name=bd><option value=0>请选择版面</option>" do while not rs.eof response.write"<option value=0 style='background-color:#e5e5e5;'>┏ "&split(rs("bdinfo"),"|")(0)&"</option>" set rs1=conn.execute("select * from bdinfo where followid="&rs("id")&" order by orders desc,id") do while not rs1.eof response.write"<option value="&rs1("id")&">┠ "&split(rs1("bdinfo"),"|")(0)&"</option>" rs1.movenext Loop set rs1=nothing rs.movenext Loop response.write"</select>" set rs=nothing %> <input type="submit" value=" 移 动 " name="a"></p></div></form> <%case"moveok" dim thisbbs thisbbs=checknum(request.form("bd")) if thisbbs=0 then tl=" 移 动 失 败" mes="<b>移动帖子失败,你没有选择版面。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。<br>·<a href='javascript:history.go(-1)'><img border=0 src="&styleid&"/re.gif align=absmiddle>返回重新选择</a>" else conn.execute("update topic set bd="&thisbbs&" where bd="&bd&" and id="&id&"") conn.execute("update bbs"&totable&" set bd="&thisbbs&" where bd="&bd&" and id="&id&"") conn.execute("update bbs"&totable&" set bd="&thisbbs&" where bd="&bd&" and bid="&id&"") tl=" 移 动 成 功" mes="<b>移动帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&thisbbs&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" end if call sendinfo(tl,mes) case"delrebbs" dim bbsid bbsid=checknum(request.querystring("bbsid")) conn.execute("update bbs"&totable&" set type=3 where bd="&bd&" and bbsid="&bbsid&"") umark2(-20) tl=" 删 除 成 功" mes="<b>删除回帖成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" call sendinfo(tl,mes) %><% case"alltop" if usertype<4 then tl=" 操 作 失 败" mes="<b>对不起!权限不够。</b>" call sendinfo(tl,mes) call down response.end end if set rs=server.createobject("adodb.recordset") sql="Select top 1 top from [topic] where id="&id&"" rs.open sql,conn,1,3 rs("top")=2 rs.Update rs.close set rs=nothing umark(50) tl=" 操 作 成 功" mes="<b>总置顶帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" call sendinfo(tl,mes) %><%case"delalltop" if usertype<4 then tl=" 操 作 失 败" mes="<b>对不起!权限不够。</b>" call sendinfo(tl,mes) call down response.end end if set rs=server.createobject("adodb.recordset") sql="Select top 1 top from [topic] where id="&id&"" rs.open sql,conn,1,3 rs("top")=0 rs.Update rs.close set rs=nothing tl=" 操 作 成 功" mes="<b>取消总置顶帖子成功,请选择你要进行的操作。</b><br>·<a href=topiclist.asp?bd="&bd&">回到"&bdinfo(0)&"</a>。<br>·<a href=showbbs.asp?bd="&bd&"&id="&id&"&totable="&totable&">回到浏览的帖子</a>。" call sendinfo(tl,mes) %><%end select call down%>